//
// 嗨~ o(*￣▽￣*)ブ
// Created by Mokou on 2020/7/14.
//

#import <Flutter/Flutter.h>

@interface Util : NSObject

/**
 * ios系统版本
 * */
+ (NSString *)getSystemVersion;


/**
 * app版本
 * */
+ (NSString *)getAppVersion;

/**
 * 获取IDFA
 * */
+ (NSString *)getIDFA;

/**
 * 跳转系统wifi
 * */
+ (void)showSysOption;

/**
 * 跳转系统拨号
 * */
+ (void)showSysTel:(NSString *)number;

+ (void)initBugly;


/**
 * 本地存储 增删改查
 * */
+ (void)localStorage_insert_string:(NSDictionary *)data;
+ (void)localStorage_insert_int:(NSDictionary *)data;
+ (void)localStorage_delete:(NSString *)key;
+ (void)localStorage_update:(NSDictionary *)data;
+ (NSString *)localStorage_select_string:(NSString *)key;
+ (int)localStorage_select_int:(NSString *)key;

/**
 * 生成UUID
 * */
+ (NSString *)getUUID;

/**
 * 检查数据是否不为nil 且不为NSNull
 * */
+ (BOOL)checkDefined:(id)id;

/**
 * 当 dict 与 key 都存在且不为NSNull时
 * 检查 dict[key] 是否为NSNull
 * */
+ (BOOL)notNull:(NSDictionary *)dict k:(NSString *)key;

/**
 * 检查数据类型是否为NSDictionary
 * */
+ (BOOL)isDict:(id)data;

/**
 * 检查数据类型是否为NSString
 * */
+ (BOOL)isString:(id)data;

/**
 * 获取当前ViewController
 * */
+ (UIViewController *)getCurrentVC;

/**
 * flutter回调数据类型统一
 * 一般查询型
 * return {"data":[{}]}
 * */
+ (NSDictionary *)callBackJson:(id)data;

/**
 * flutter回调数据类型统一
 * 分页查询型
 * return {"data":[{}],"total":Int,"isOver":boolean}
 * */
+ (NSDictionary *)callBackJson_select:(NSArray *)data total:(int)total isOver:(BOOL)isOver;

+ (CGFloat)getHeightForString:(NSString *)str lineSpacing:(CGFloat)lineSpacing fontSize:(CGFloat)size andWidth:(CGFloat)width;

+ (CGFloat)px:(CGFloat)dp;

/**
 * 提示信息
 * */
+ (void)toast:(NSString *)msg;

+ (long long int)now;

/**
 * 通过相对路径获取绝对路径
 * */
+ (NSString *)getAbsolutePath:(NSString *)relativePath;

+ (NSString *)wifiName;

+ (void)alertNeedLocationAuthorization;

@end
